package cn.edu.bit.learn.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import cn.edu.bit.learn.dao.ManageDAO;
import cn.edu.bit.learn.form.ManageForm;

public class ManageAction extends DispatchAction {
	public ActionForward login(ActionMapping mapping,ActionForm form,
			HttpServletRequest request, HttpServletResponse response)throws Exception{
		System.out.println("d---------------------------------------");
			ManageForm mform =(ManageForm)form;
			System.out.println(mform.getManageId()+"和"+mform.getManagePwd());
			ManageDAO mdao= new ManageDAO();
			boolean checkLogin=mdao.login(mform);
			if(checkLogin){
				request.setAttribute("mform", mform);
				return mapping.findForward("success");
			}
				return mapping.findForward("failed");
		
	}
}
